import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity()
export class GroupToScript {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  scriptuuid: string;

  @Column()
  groupuuid: string;

  @Column()
  belong: string;

  @Column({ default: false })
  locked: boolean;

  @Column({ default: '' })
  locked_by: string;

  @Column({ type: 'timestamp',default: () => 'CURRENT_TIMESTAMP' })
  lock_timestamp: Date;

  @Column({
    name: 'create_time',
    type: 'timestamp without time zone',
    default: () => 'CURRENT_TIMESTAMP',
  })
  create_time: Date;

  @UpdateDateColumn({
    name: 'update_time',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
  })
  update_time: Date;
}
